class CreateUserLevelRules < ActiveRecord::Migration
  def self.up
    create_table :user_level_rules do |t|
      t.string :name
      t.integer :view_level_id
      t.integer :post_level_id
      t.integer :reply_level_id

      t.timestamps
    end

    remove_column :categories, :user_level_id
    add_column :categories, :user_level_rule_id, :integer
  end

  def self.down
    drop_table :user_level_rules
    
    add_column :categories, :user_level_id, :integer
    remove_column :categories, :user_level_rule_id
  end
end
